import request from '@/utils/request'

// 查询聊天消息记录列表
export function listMessageLog(query) {
  return request({
    url: '/biz/messageLog/list',
    method: 'get',
    params: query
  })
}

// 查询聊天消息记录详细
export function getMessageLog(id) {
  return request({
    url: '/biz/messageLog/' + id,
    method: 'get'
  })
}

// 新增聊天消息记录
export function addMessageLog(data) {
  return request({
    url: '/biz/messageLog',
    method: 'post',
    data: data
  })
}

// 修改聊天消息记录
export function updateMessageLog(data) {
  return request({
    url: '/biz/messageLog',
    method: 'put',
    data: data
  })
}

// 删除聊天消息记录
export function delMessageLog(id) {
  return request({
    url: '/biz/messageLog/' + id,
    method: 'delete'
  })
}

// 启用禁用聊天消息记录
export function changeStatus(data) {
  return request({
    url: '/biz/messageLog/changeStatus',
    method: 'put',
    data: data
  })
}

//根据会话id设置聊天消息已读
export function setMessageReadByConversationId(conversationId) {
  return request({
    url: '/biz/messageLog/setMessageRead/' + conversationId,
    method: 'post',
  })
}
//设置单挑聊天消息已读
export function setMessageReadById(messageId) {
  return request({
    url: '/biz/messageLog/setMessageReadById/' + messageId,
    method: 'post',
  })
}
